package com.foreknow.demo10;

import com.foreknow.demo2.C;

public class Test9 {
    public void RegInfo(String username,String password) throws CustomException{
        //如何获取用户输入的名字和密码的长度
        int usernameLength = username.length();
        int passwordLength = password.length();

        if(usernameLength < 3 || passwordLength > 14) {
            throw new CustomException("这不符合规范");
        }
    }

    public static void main(String[] args) {
        Test9 test9 = new Test9();

        try {
            test9.RegInfo("to","123456");
        } catch (CustomException e) {
            e.printStackTrace();
        }

    }


}
